1
//--------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //--------------------------------------------------------------------------
9 namespace Microsoft
.ParallelComputingPlatform
.ParallelExtensions
.Samples
11 class Plane
: SceneObject
16 public Plane(Vector norm
, double offset
, Surface surface
) : base(surface
) { Norm = norm; Offset = offset; }
18 public override ISect
Intersect(Ray ray
)
20 double denom
= Vector
.Dot(Norm
, ray
.Dir
);
21 if (denom
> 0) return ISect
.Null
;
22 return new ISect(this, ray
, (Vector
.Dot(Norm
, ray
.Start
) + Offset
) / (-denom
));
25 public override Vector
Normal(Vector pos
)